package com.yupi.yuaiagent;

import org.junit.jupiter.api.Test;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class SpringAIChatModel {

    @Autowired
    private ChatModel chatModel;

    @Test
    void chatClientText(){
        
    }

    @Test
    void chatModelText() {
        AssistantMessage assistantMessage = chatModel.call(new Prompt("你好哥，你叫啥啊？"))
                .getResult()
                .getOutput();
        String text = assistantMessage.getText();
        System.out.println(text);
    }
}
